import Vue from 'vue'
import Router from 'vue-router'
import login from '../views/base/login'
import index from '../views/index'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/index',
      name: 'home',
      redirect: '/index/home', // 默认选择第一个
      component: index,
      children: [
        {
          path: '/index/home',
          name: 'home',
          component: () => import('@/views/base/home') // 组件地址
        },
        {
          path: '/index/biaodan_list',
          name: 'biaodan_list',
          component: () => import('@/views/zujian/biaodan_list')
        },
        {
          path: '/index/list2_list',
          name: 'list2_list',
          component: () => import('@/views/zujian/list2_list')
        },
        {
          path: '/index/tubiao_list',
          name: 'tubiao_list',
          component: () => import('@/views/echars/tubiao_list')
        },
        {
          path: '/index/tree_list',
          name: 'tree_list',
          component: () => import('@/views/zujian/tree_list')
        },
        {
          path: '/index/excel_list',
          name: 'excel_list',
          component: () => import('@/views/excel/excel_list')
        }
      ]
    },
    {
      path: '/test',
      // redirect: '/test/account', // 默认选择第一个
      name: 'test',
      component: () => import('@/views/test'),
      children: [
        {
          path: '/test/account',
          name: 'account',
          component: () => import('@/views/components/account') // 组件地址
        },
        {
          path: '/test/notification',
          name: 'notification',
          component: () => import('@/views/components/notification') // 组件地址
        }
      ]
    }

  ]
})
